<?php $ttotle = 0; ?>
<table>
	<?php foreach($advice['details'] as $key=>$val){ ?>
	<tr>
		<td><?php echo $val['info']['search_code'] ?></td>
	</tr>
			<?php foreach($val['sub'] as $k=>$v){ ?>
			<tr>
			<td><?php echo $v['info']['attribute']; ?></td>
			<td class="price"><?php echo $v['price'] ?>￥</td>
			<td>
			<?php
			$totle = 0;
			foreach ($v['stock'] as $stock) {
				$totle += $stock['quantity'];
				$ttotle += $stock['quantity'];
			}
			echo $totle;
			?>件
			</td>
			</tr>
			<?php } ?>
	<?php } ?>
</table>
<?php echo $ttotle; ?>